package com.quanyan.weichat.protocol.pay_status_query_protocal;

import com.quanyan.weichat.common.Configure;
import com.quanyan.weichat.common.RandomStringGenerator;
import com.quanyan.weichat.common.Signature;

/**
 * @author songzj
 * @date 16/6/21-18:08
 */
public class PayStatusQueryReqData {

    private String appid;

    private String mch_id;

    private String transaction_id;

    private String out_trade_no;

    private String nonce_str;

    private String sign;

    public PayStatusQueryReqData(String out_trade_no, String transaction_id, Configure configure) {
        this.appid = configure.getAppID();
        this.mch_id = configure.getMchID();
        this.out_trade_no = out_trade_no;
        this.transaction_id = transaction_id;
        this.nonce_str = RandomStringGenerator.getRandomStringByLength(32);
        try {
            sign = Signature.getSign(this, configure.getKey());
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
    }

    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getMch_id() {
        return mch_id;
    }

    public void setMch_id(String mch_id) {
        this.mch_id = mch_id;
    }

    public String getTransaction_id() {
        return transaction_id;
    }

    public void setTransaction_id(String transaction_id) {
        this.transaction_id = transaction_id;
    }

    public String getOut_trade_no() {
        return out_trade_no;
    }

    public void setOut_trade_no(String out_trade_no) {
        this.out_trade_no = out_trade_no;
    }

    public String getNonce_str() {
        return nonce_str;
    }

    public void setNonce_str(String nonce_str) {
        this.nonce_str = nonce_str;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }
}
